//
//  TableGameInfo.m
//  PokerHandUp
//
//  Created by psvn047 on 6/22/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "TableGameInfo.h"

@implementation TableGameInfo
@synthesize twoCards;
@synthesize threeCards;
@synthesize fourCards;
@synthesize fiveCards;
@synthesize sixCards;
@synthesize sevenCards;
@synthesize eightCards;
@synthesize nineCards;
@synthesize tenCards;
@synthesize jokerCards;
@synthesize queenCards;
@synthesize kingCards;
@synthesize aceCards;

@synthesize clubCards;
@synthesize spadeCards;
@synthesize heartCards;
@synthesize diamondCards;

-(void) resetInfo
{
    twoCards = 0;
    threeCards = 0;
    fourCards = 0;
    fiveCards =0;
    sixCards =0;
    sevenCards = 0;
    eightCards = 0;
    nineCards = 0;
    tenCards = 0;
    jokerCards = 0;
    queenCards = 0;
    kingCards = 0;
    aceCards = 0;
    
    heartCards = 0;
    diamondCards = 0;
    clubCards = 0;
    spadeCards = 0;
}

-(BOOL) checkFourOfAKind
{
    if(twoCards == 4 || threeCards == 4 || fourCards == 4 || fiveCards == 4 || sixCards == 4 || sevenCards == 4 || eightCards == 4 || nineCards == 4 || tenCards == 4 || jokerCards == 4 || queenCards == 4 || kingCards == 4 || aceCards == 4)
    {
        return true;
    }
    return false;
}
-(BOOL) checkFullHouse
{
    if((twoCards == 3 || threeCards == 3 || fourCards == 3 || fiveCards == 3 || sixCards == 3 || sevenCards == 3 || eightCards == 3 || nineCards == 3 || tenCards == 3 || jokerCards == 3 || queenCards == 3 || kingCards == 3 || aceCards == 3) &&
       (twoCards == 2 || threeCards == 2 || fourCards == 2 || fiveCards == 2 || sixCards == 2 || sevenCards == 2 || eightCards == 2 || nineCards == 2 || tenCards == 2 || jokerCards == 2 || queenCards == 2 || kingCards == 2 || aceCards == 2))
    {
        return true;
    }
    return false;
}
// please call checkFullHouse before this method
-(BOOL) checkTwoPair
{
    if((twoCards == 2 || threeCards == 2 || fourCards == 2 || fiveCards == 2 || sixCards == 2 || sevenCards == 2 || eightCards == 2 || nineCards == 2 || tenCards == 2 || jokerCards == 2 || queenCards == 2 || kingCards == 2 || aceCards == 2) &&
       (twoCards == 2 || threeCards == 2 || fourCards == 2 || fiveCards == 2 || sixCards == 2 || sevenCards == 2 || eightCards == 2 || nineCards == 2 || tenCards == 2 || jokerCards == 2 || queenCards == 2 || kingCards == 2 || aceCards == 2))
    {
        return true;
    }
    return false;
}
// please call checkTwoPair before this method
-(BOOL) checkPair
{
    if(twoCards == 2 || threeCards == 2 || fourCards == 2 || fiveCards == 2 || sixCards == 2 || sevenCards == 2 || eightCards == 2 || nineCards == 2 || tenCards == 2 || jokerCards == 2 || queenCards == 2 || kingCards == 2 || aceCards == 2)
    {
        return true;
    }
    return false;
}
-(BOOL) checkStraight
{
    if(tenCards >= 1 &&  jokerCards >= 1 && queenCards >= 1 && kingCards >= 1 && aceCards >= 1)
    {
        return true;
    }
    if(nineCards >= 1 &&  tenCards >= 1 && jokerCards >= 1 && queenCards >= 1 && kingCards >= 1)
    {
        return true;
    }
    if(eightCards >= 1 &&  nineCards >= 1 && tenCards >= 1 && jokerCards >= 1 && queenCards >= 1)
    {
        return true;
    }
    if(sevenCards >= 1 &&  eightCards >= 1 && nineCards >= 1 && tenCards >= 1 && jokerCards >= 1)
    {
        return true;
    }
    if(sixCards >= 1 &&  sevenCards >= 1 && eightCards >= 1 && nineCards >= 1 && tenCards >= 1)
    {
        return true;
    }
    if(fiveCards >= 1 &&  sixCards >= 1 && sevenCards >= 1 && eightCards >= 1 && nineCards >= 1)
    {
        return true;
    } 
    if(fourCards >= 1 &&  fiveCards >= 1 && sixCards >= 1 && sevenCards >= 1 && eightCards >= 1)
    {
        return true;
    }
    if(threeCards >= 1 &&  fourCards >= 1 && fiveCards >= 1 && sixCards >= 1 && sevenCards >= 1)
    {
        return true;
    }
    if(twoCards >= 1 &&  threeCards >= 1 && fourCards >= 1 && fiveCards >= 1 && sixCards >= 1)
    {
        return true;
    }
    if(aceCards >= 1 &&  twoCards >= 1 && threeCards >= 1 && fourCards >= 1 && fiveCards >= 1)
    {
        return true;
    }
    return false;
}
-(BOOL) checkFlush
{ 
    if(heartCards >= 5 || diamondCards >= 5 || clubCards >= 5 || spadeCards >= 5)
    {
        return true;
    }
    
    return false;
}
-(BOOL) checkRoyalFlush //not right
{
    if(tenCards >= 1 &&  jokerCards >= 1 && queenCards >= 1 && kingCards >= 1 && aceCards >= 1)
    {
        return true;
    }
    if(heartCards >= 5 || diamondCards >= 5 || clubCards >= 5 || spadeCards >= 5)
    {
           }
    return false;
}
@end
